<!--
 * @Date: 2024-11-22 10:29:27
 * @LastEditors: Lcx l1556461835@163.com
 * @LastEditTime: 2025-03-03 11:07:57
 * @FilePath: \fushun-gitee\pages\standard\orderRecordInfo\index.vue
 * @Description: 
-->
<template>
  <div>
    <page-title title="已审核订单/修改意见订单记录/修改详情" home-path="/standard/home"></page-title>
    <div class="pageMain">
      <div class="pageMain-title">
        <span>技术审评意见修改详情(首评)</span>
      </div>
      <div class="pageMain-body">
        <div class="container">
          <div class="left-half">
            <div class="half-main">
              <h2 style="text-align:center">修改前技术评审意见</h2>
              <div>
                <h3 style="margin-bottom: 10px">技术评审人员意见</h3>
                <el-table :data="oldOrderInfo.reviewInfos" border>
                  <el-table-column label="部门" prop="department"></el-table-column>
                  <el-table-column label="评审人" prop="assessor"></el-table-column>
                  <el-table-column label="评审意见" prop="comment"></el-table-column>
                </el-table>
                <table class="uTable" style="margin: 10px 0">
                  <tbody>
                    <tr>
                      <td style="width: 180px"><span>是否引起成本变化</span></td>
                      <td>
                        {{ oldOrderInfo.isCostByChange == null ? "" : oldOrderInfo.isCostByChange == 0 ? "否" : "是" }}
                      </td>
                    </tr>
                    <tr>
                      <td><span>首试制</span></td>
                      <td>{{ oldOrderInfo.isMake == null ? "" : oldOrderInfo.isMake == 0 ? "否" : "是" }}</td>
                    </tr>
                    <tr>
                      <td><span>风险评估等级</span></td>
                      <td> {{ oldOrderInfo.assess == null ? "" : oldOrderInfo.assess == 0
                        ? "高"
                        : oldOrderInfo.assess == 1
                        ? "中"
                        : "低" }} </td>
                    </tr>
                    <tr>
                      <td><span>外委情况</span></td>
                      <td>{{ oldOrderInfo.outsourcingStatus == null ? "" : oldOrderInfo.outsourcingStatus == 0 ? "无需外委" : "需要外委" }}</td>
                    </tr>
                  </tbody>
                </table>
                <div>
                  <span>成本预测：</span>
                  <el-button type="text" size="medium">
                    测算详情
                  </el-button>
                </div>
                <div style="margin: 10px 0">
                  <div>
                    <span>评审结论：</span>
                    <span>
                      {{ oldOrderInfo.receivingState ? oldOrderInfo.receivingState == 0 ? "不接单" : oldOrderInfo.receivingState == 1 ? "接单" : oldOrderInfo.receivingState == 2 ? "带条件生产" : "" : "" }}
                    </span>
                  </div>
                  <div v-if="oldOrderInfo.receivingState && oldOrderInfo.receivingState==2">
                    <span>评审备注：</span>
                    <span>{{ oldOrderInfo.receivingRemark }}</span>
                  </div>
                </div>
                <div style="margin-top: 20px">
                  <h3 style="margin-bottom: 10px">主任综合意见</h3>
                  <div>
                    <h4>总工办/技术中心主任/副主任意见</h4>
                    <p>
                      {{ oldOrderInfo.remark ? oldOrderInfo.remark : "" }}
                    </p>
                  </div>
                </div>
              </div>
            </div>
            
          </div>
          <div class="vertical-line"></div>
          <div class="right-half">
            <div class="half-main">
              <h2 style="text-align:center">修改后技术评审意见</h2>
              <div>
                <h3 style="margin-bottom: 10px">技术评审人员意见</h3>
                <el-table :data="newOrderInfo.reviewInfos" border>
                  <el-table-column label="部门" prop="department"></el-table-column>
                  <el-table-column label="评审人" prop="assessor"></el-table-column>
                  <el-table-column label="评审意见" prop="comment"></el-table-column>
                </el-table>
                <table class="uTable" style="margin: 10px 0">
                  <tbody>
                    <tr>
                      <td style="width: 180px"><span>是否引起成本变化</span></td>
                      <td>
                        {{ newOrderInfo.isCostByChange == null ? "" : newOrderInfo.isCostByChange == 0 ? "否" : "是" }}
                      </td>
                    </tr>
                    <tr>
                      <td><span>首试制</span></td>
                      <td>{{  newOrderInfo.isMake == null ? "" : newOrderInfo.isMake == 0 ? "否" : "是" }}</td>
                    </tr>
                    <tr>
                      <td><span>风险评估等级</span></td>
                      <td> {{ newOrderInfo.assess == null ? "" : newOrderInfo.assess == 0
                        ? "高"
                        : newOrderInfo.assess == 1
                        ? "中"
                        : "低" }} </td>
                    </tr>
                    <tr>
                      <td><span>外委情况</span></td>
                      <td>{{ newOrderInfo.outsourcingStatus == null ? "" : newOrderInfo.outsourcingStatus == 0 ? "无需外委" : "需要外委"  }}</td>
                    </tr>
                  </tbody>
                </table>
                <div>
                  <span>成本预测：</span>
                  <el-button type="text" size="medium">
                    测算详情
                  </el-button>
                </div>
                <div style="margin: 10px 0">
                  <div>
                    <span>评审结论：</span>
                    <span>
                      {{ newOrderInfo.receivingState ? newOrderInfo.receivingState == 0 ? "不接单" : newOrderInfo.receivingState == 1 ? "接单" : newOrderInfo.receivingState == 2 ? "带条件生产" : "" : "" }}
                    </span>
                  </div>
                  <div v-if="newOrderInfo.receivingState && newOrderInfo.receivingState==2">
                    <span>评审备注：</span>
                    <span>{{ newOrderInfo.receivingRemark }}</span>
                  </div>
                </div>
                <div style="margin-top: 20px">
                  <h3 style="margin-bottom: 10px">主任综合意见</h3>
                  <div>
                    <h4>总工办/技术中心主任/副主任意见</h4>
                    <p>{{ newOrderInfo.remark ? newOrderInfo.remark : '' }}</p>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import PageTitle from "@/components/PageTitle";
import { GET_STANDARD_UPDATEOPINIONRECORD } from "@/lib/Api.js";
import { post } from "@/lib/Util.js";
export default {
  components: {
    PageTitle
  },
  data() {
    return {
      newOrderInfo: {},
      oldOrderInfo: {},
      id: null
    };
  },
  created() {
    // this.id = this.$route.query.id;
    // this.getData(this.id);
    this.getData("65430302621693");
  },

  methods: {
    getData(id) {
      post(GET_STANDARD_UPDATEOPINIONRECORD, { id: id }).then(resp => {
        if (resp.code === 200) {
          console.log("===", resp);
          console.log(resp.data.new);
          this.newOrderInfo = resp.data.new;
          this.oldOrderInfo = resp.data.old;
          console.log(this.newOrderInfo, this.oldOrderInfo);
        }
      });
    }
  }
};
</script>

<style scoped>
.container {
  display: flex;
  width: 90vw;
  margin: auto 0;
}

.left-half,
.right-half {
  flex: 1;
  padding: 10px;
  box-sizing: border-box;
}

::v-deep .el-descriptions__table {
  font-size: 16px;
}

.vertical-line {
  width: 2px;
  background-color: #ccc;
  height: calc(100vh - 180px);
}
.half-main {
  width: 86%;
  margin: 0 auto;
}
</style>
